const { exec } = require('../db/mysql')

const getList = async (name, [password]) => {
    let sql = `select * from accounts where 1=1 `
    if (name) {
        sql += `and name='${name}' and password=${password}`
    }

    sql += `order by createtime desc;`
    console.log(sql)
    return await exec(sql)
}

module.exports = {
    getList
}